n,k=map(int,raw_input().split(" "));
s=raw_input()
for i in range(k):
	s=s.replace("BG","GB")
print s